function setClockValues(idH, idM, idS, idAmPm){
    var objH = document.getElementById(idH); 
    var objM = document.getElementById(idM);
    var objS = document.getElementById(idS);
    var objA = document.getElementById(idAmPm);
    
    var sec = eval(objS.innerHTML) + 1;
    if(sec != 60){
        objS.innerHTML = sec > 9 ? sec : '0' + sec;
    } else {
        objS.innerHTML = '00';
        var min = eval(objM.innerHTML) + 1;
        if(min != 60){
            objM.innerHTML = min > 9 ? min : '0' + min;
        } else {
            objM.innerHTML = '00';
            var hour = eval(objH.innerHTML) + 1;
            if(hour < 12){
                objH.innerHTML = hour > 9 ? hour : '0' + hour;
            } else {
                var amPm = objA.innerHTML;
                if(amPm){
                    if(hour != 12) {
                        objH.innerHTML = '01';
                    } else {
                        if(amPm == 'AM'){
                            objH.innerHTML = hour;
                            objA.innerHTML = 'PM';
                        } else {
                            objH.innerHTML = '00';
                            objA.innerHTML = 'AM';
                        }
                    }
                } else {
                    if(hour != 24){
                        objH.innerHTML = hour;
                    } else {
                        objH.innerHTML = '00';
                        objA.innerHTML = 'AM';
                    }
                }
            }
        }
    }
}


